layui.use('form', function() {
	var form = layui.form;
	var layer = layui.layer;
	
	if(exception) {
		layAlertFailed(exception);
	}
	if(success) {
		layAlertSuccess(success);
	}
	
	//自定义验证规则
    form.verify({
        password: function (value) {
        	var reg = /(?!^(\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\w~!@#$%^&*?]{8,16}$/;
        	if(!reg.test(value)) {
        		return "密码不能包括空格，长度为8-16个字符且必须包含字母、数字、符号中至少2种";
        	}
        },
        comparePassword: function (value) {
        	if(value != $("#newPassword").val()) {
        		return "确认密码与新密码输入不一致";
        	}
        }
    });
    
    form.on('submit(modifyPassword)', function(data){
    	return true;
	});
});